package com.ncr.travel.appmgr.model;

import com.ncr.travel.appmgr.model.shared.ErrorText;


public class ErrorTextJson extends TextJson implements ErrorText {

	private Integer code;
	private String message;

	/* (non-Javadoc)
	 * @see com.ncr.travel.appmgr.model.ErrorText#getCode()
	 */
	@Override
	public Integer getCode() {
		return code;
	}

	/* (non-Javadoc)
	 * @see com.ncr.travel.appmgr.model.ErrorText#setCode(java.lang.Integer)
	 */
	@Override
	public void setCode(Integer code) {
		this.code = code;
	}

	/* (non-Javadoc)
	 * @see com.ncr.travel.appmgr.model.ErrorText#getMessage()
	 */
	@Override
	public String getMessage() {
		return message;
	}

	/* (non-Javadoc)
	 * @see com.ncr.travel.appmgr.model.ErrorText#setMessage(java.lang.String)
	 */
	@Override
	public void setMessage(String message) {
		this.message = message;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((code == null) ? 0 : code.hashCode());
		result = prime * result + ((message == null) ? 0 : message.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (!super.equals(obj)) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		ErrorTextJson other = (ErrorTextJson) obj;
		if (code == null) {
			if (other.code != null) {
				return false;
			}
		} else if (!code.equals(other.code)) {
			return false;
		}
		if (message == null) {
			if (other.message != null) {
				return false;
			}
		} else if (!message.equals(other.message)) {
			return false;
		}
		return true;
	}

}
